<h1>商品列表</h1>

<div id="product-list">
<div class="TitleProduct">
      <div class="TitleProductImg">图片</div>     
      <div class="TitleInfo">商品信息</div>      
      <div class="TitleOwner">数量</div>
      <div class="TitleOwner">价格</div>
      <div class="TitleOwner">操作</div>
    </div>
<% for product in @products %>
  <DIV class=HackBox></DIV>
  <div class="Product">
      <div class="ProductImg">
      <%=link_to(image_tag(product.img_url,:class=>"list-image"),{:controller=>"products",:action=>"show",:id=>product.id})%>
      </div>
      <div class="ProductInfo">
        <div class="ProductName"><span class="ProductFont"><%=link_to product.title,:controller=>"products",:action=>"show",:id=>product.id %></span></div>
        <div class="ProductDsc"><span class="ProductFont">描述：<%=h product.description %></span></div>
      </div>
      <div class="ProductOwner"><span class="ProductFont"><%=h product.amount %></span></div>
      <div class="ProductOwner"><span class="ProductFont"><%=h product.price %></span></div>  
      <div class="ProductOwner">
        <span class="ProductFont">
            <%= link_to '查看', {:action=>"product_show",:id=>product.id}%> 
            <%= link_to '编辑', {:action=>"product_edit",:id=>product.id} %>
            <!--%= link_to '撤下',{:action=>"product_offsell",:id=>product.id},:method=>:post,:confirm=>"你确定要撤下#{product.title}吗？"%-->
        </span>
      </div>
    </div>
<% end %>
</div>
<%= link_to '发布新商品',{:action=>"product_new"} %>
<%= will_paginate @products,:prev_label=>"上一页",:next_label=>"下一页" %>